<head>
  <style>
      table, th, td {
          border: 1px solid black;
          border-collapse: collapse;
      }
      th, td {
          padding: 15px;
          text-align: center;
      }
  </style>
</head>

<h1 align="center">Approve Requested Openings</h1>

<table style="width:100%" bgcolor="#F6F6FF">
  <tr>
    <th>ID</th>
    <th>Posting ID</th>
    <th>Position ID</th>
    <th>Title</th>
    <th>Description</th>
    <th>Store ID</th>
    <th>Count</th>
    <th>Approve</th>
    <th>Delete</th>
  </tr>

  <% @positions.each do |position| %>
      <tr>
        <td><%= position.id %></td>
        <td><%= position.posting_id %></td>
        <td><%= position.position_type_id %></td>
        <td><%= position.title %></td>
        <td><%= position.description %></td>
        <td><%= position.store_id %></td>
        <td><%= position.job_count %></td>
        <td><%= button_to('Approve', store_manager_approve_path(id: position.id), action: :approve) %></td>
        <td><%= button_to('Delete', store_manager_path(position), method: :delete, data: { confirm: 'Are you sure?' }) %></td>
      </tr>
  <% end %>
</table>

<br>
<br>

<%= link_to('Back to Store Manager Home', store_manager_home_path) %>
